﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ux="clr-namespace:Goto.UX">
	
    <Style TargetType="ux:RoundButton">
        <Setter Property="Background" Value="#CCFFFFFF"/>
        <Setter Property="MouseOverColor" Value="#CCC8C8C8"/>
        <Setter Property="Height" Value="120"/>
        <Setter Property="Width" Value="120"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="BlurRadius" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ux:RoundButton">
                    <Grid>
                        <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Name="back" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}">
                            <Border.Effect>
                                <DropShadowEffect BlurRadius="{Binding BlurRadius, RelativeSource={RelativeSource TemplatedParent}}" Opacity="0.8" ShadowDepth="0"/>
                            </Border.Effect>
                        </Border>
                        <Border CornerRadius="{TemplateBinding CornerRadius}">
                            <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="auto"/>
                                </Grid.RowDefinitions>
                                <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="{TemplateBinding Icon}" Width="80" Height="80"/>
                                <Label Grid.Row="1" Foreground="{TemplateBinding Foreground}" Content="{TemplateBinding Content}"/>
                            </Grid>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="true">
                            <Setter TargetName="back" Property="Background" Value="{Binding MouseOverColor, RelativeSource={RelativeSource TemplatedParent}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style TargetType="ux:UXWindow">
        <Setter Property="WindowStyle" Value="None"/>
        <Setter Property="ResizeMode" Value="CanMinimize"/>
        <Setter Property="AllowsTransparency" Value="True"/>
        <Setter Property="BlurRadius" Value="10"/>
        <Setter Property="Height" Value="560" />
        <Setter Property="Width" Value="860"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="CornerRadius" Value="6"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ux:UXWindow">
                    <Grid Margin="10">
                        <Border Background="{TemplateBinding UIBackground}" CornerRadius="{TemplateBinding CornerRadius}">
                            <Border.Effect>
                                <DropShadowEffect BlurRadius="{Binding BlurRadius, RelativeSource={RelativeSource TemplatedParent}}" ShadowDepth="0" Opacity="0.8"/>
                            </Border.Effect>
                        </Border>
                        
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="auto"/>
                            </Grid.ColumnDefinitions>
                            <Frame/>

                            <Grid Name="homeborder" Width="{TemplateBinding HomeWidth}" Grid.Column="1">
                                <Border Background="{TemplateBinding HomeBackground}" CornerRadius="{TemplateBinding CornerRadius}" >
                                    <Border.Effect>
                                        <DropShadowEffect ShadowDepth="0"/>
                                    </Border.Effect>
                                </Border>
                                <Border CornerRadius="{TemplateBinding CornerRadius}" ClipToBounds="True" SnapsToDevicePixels="True">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="25"/>
                                            <RowDefinition />
                                        </Grid.RowDefinitions>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="25"/>
                                                <ColumnDefinition />
                                            </Grid.ColumnDefinitions>
                                            <Button Name="homebtnShow" Visibility="Collapsed">
                                                <Button.Triggers>
                                                    <EventTrigger RoutedEvent="Button.Click">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="homebtnHide" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="homebtnShow" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <DoubleAnimation Storyboard.TargetName="homeborder" From="{TemplateBinding HomeMinWidth}" To="{Binding HomeMaxWidth, RelativeSource={RelativeSource TemplatedParent}}"  Duration="0:0:0.5" AccelerationRatio="0.10" DecelerationRatio="0.25" Storyboard.TargetProperty="(Grid.Width)" />
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                </Button.Triggers>
                                            </Button>
                                            <Button Name="homebtnHide">
                                                <Button.Triggers>
                                                    <EventTrigger RoutedEvent="Button.Click">
                                                        <BeginStoryboard>
                                                            <Storyboard>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="homebtnHide" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame Value="{x:Static Visibility.Collapsed}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="homebtnShow" Storyboard.TargetProperty="Visibility">
                                                                    <DiscreteObjectKeyFrame Value="{x:Static Visibility.Visible}" />
                                                                </ObjectAnimationUsingKeyFrames>
                                                                <DoubleAnimation Storyboard.TargetName="homeborder" From="{TemplateBinding HomeMaxWidth}" To="{Binding HomeMinWidth, RelativeSource={RelativeSource TemplatedParent}}"  Duration="0:0:0.5" AccelerationRatio="0.10" DecelerationRatio="0.25" Storyboard.TargetProperty="(Grid.Width)" />
                                                            </Storyboard>
                                                        </BeginStoryboard>
                                                    </EventTrigger>
                                                </Button.Triggers>
                                            </Button>
                                        </Grid>
                                        <ContentPresenter Grid.Row="1"/>
                                    </Grid>
                                </Border>
                            </Grid>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
</ResourceDictionary>